cmake_minimum_required(VERSION 2.6)
project(protocol4z)

set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "")

set(LIB_SUFFIX "")
if (WIN32)
  if(CMAKE_GENERATOR MATCHES "Win64")
    if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
      set(LIB_SUFFIX "_win64")
    else()
      set(LIB_SUFFIX "_win64d")
    endif()
  else()
    if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
      set(LIB_SUFFIX "_win32")
    else()
      set(LIB_SUFFIX "_win32d")
    endif()
  endif()
else(WIN32)
  if (CMAKE_BUILD_TYPE STREQUAL "Debug")
    add_definitions(-Wall -g -ggdb -O0 )
    set(LIB_SUFFIX "_d")
  else()
    add_definitions(-Wall -O2 -DNDEBUG )
    set(LIB_SUFFIX "")
  endif()
endif(WIN32)

SET(PROTOCOL4Z_BIN_OUT_PATH ${protocol4z_SOURCE_DIR}/test/bin)

add_subdirectory(g++)
add_subdirectory(test)

